#include<stdio.h>
#include<stdlib.h>
int main() {
    freopen("month.in","r",stdin);
    int y,m,day;
    while(2==scanf("%d%d",&y,&m)) {
        if(m<1||m>12)
            day=-1;
        else if(m==1||m==3||m==5||m==7||m==8||m==10||m==12)
            day=31;
        else if(m==4||m==6||m==9||m==11)
            day=30;
        else if((y%4==0 && y%100!=0)||y%400==0)
            day=29;
        else
            day=28;
        if(day>0)
            printf("%d\n",day);
        else
            puts("Are you kidding?");
    }

    return 0;
}
